<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
    <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>约键</title>
    <meta name="description" content="这是一个 index 页面">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="icon" type="image/png" href="/neu_yuejian201/Public/assets/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="/neu_yuejian201/Public/assets/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI" />
    <script src="/neu_yuejian201/Public/assets/js/echarts.min.js"></script>
    <link rel="stylesheet" href="/neu_yuejian201/Public/assets/css/amazeui.min.css" />
    <link rel="stylesheet" href="/neu_yuejian201/Public//neu_yuejian201/Public/assets/css/amazeui.datatables.min.css" />
    <link rel="stylesheet" href="/neu_yuejian201/Public/assets/css/app.css">
    <script src="/neu_yuejian201/Public/assets/js/jquery.min.js"></script>

</head>
    <style type="text/css">
        #video{
            display: none;
            z-index:999;
            position:absolute;
            margin-left: 300px;
        }
    </style>
<body data-type="widgets">
    <script src="/neu_yuejian201/Public/assets/js/theme.js"></script>
    <div class="am-g tpl-g">
        <!-- 头部 -->
            <header>
            <!-- logo -->
            <div class="am-fl tpl-header-logo">
                <a href="javascript:;"><img src="/neu_yuejian201/Public/assets/img/logo.png"></a>
            </div>
            <!-- 右侧容 -->
            <div class="tpl-header-fluid">
                <!-- 侧边切换 -->
                <div class="am-fl tpl-header-switch-button am-icon-list">
                    <span>

                </span>
                </div>
                <!-- 其它功能-->
                <div class="am-fr tpl-header-navbar">
                    <ul>
                        <!-- 欢迎语 -->
                        <li class="am-text-sm tpl-header-navbar-welcome">
                            <a href="javascript:;">欢迎你, <span>Amaze UI</span> </a>
                        </li>
                        <!-- 退出 -->
                        <li class="am-text-sm">
                            <a href="<?php echo U('Public/signout');?>">
                                <span class="am-icon-sign-out"></span> 退出
                            </a>
                        </li>
                    </ul>
                </div>
            </div>

        </header>
        <!-- 风格切换 -->
        <div class="tpl-skiner">
            <div class="tpl-skiner-toggle am-icon-cog">
            </div>
            <div class="tpl-skiner-content">
                <div class="tpl-skiner-content-title">
                    选择主题
                </div>
                <div class="tpl-skiner-content-bar">
                    <span class="skiner-color skiner-white" data-color="theme-white"></span>
                    <span class="skiner-color skiner-black" data-color="theme-black"></span>
                </div>
            </div>
        </div>
        
<div class="left-sidebar">
            <!-- 菜单 -->
            <ul class="sidebar-nav">
                <li class="sidebar-nav-link">
                    <a href="<?php echo U('Club/club/editclub');?>">
                        <i class="am-icon-home sidebar-nav-link-logo"></i> 管理俱乐部信息
                    </a>
                </li>
                <li class="sidebar-nav-link">
                    <a href="<?php echo U('Club/video/videolist');?>">
                        <i class="am-icon-table sidebar-nav-link-logo"></i> 管理视频
                    </a>
                </li>
                <li class="sidebar-nav-link">
                    <a href="<?php echo U('Club/coach/coachlist');?>">
                        <i class="am-icon-calendar sidebar-nav-link-logo"></i> 管理教练
                    </a>
                </li>
                <li class="sidebar-nav-link">
                    <a href="<?php echo U('Club/course/courselist');?>">
                        <i class="am-icon-wpforms sidebar-nav-link-logo"></i> 管理课程

                    </a>
                </li>
                <li class="sidebar-nav-link">
                    <a href="<?php echo U('Club/activity/activitylist');?>">
                        <i class="am-icon-bar-chart sidebar-nav-link-logo"></i> 管理活动

                    </a>
                </li>
                <li class="sidebar-nav-link">
                    <a href="<?php echo U('Club/train/trainlist');?>">
                        <i class="am-icon-bar-chart sidebar-nav-link-logo"></i> 管理培训

                    </a>
                </li>
            </ul>
        </div>
        <!-- 内容区域 -->
        <div class="tpl-content-wrapper">

            <div class="row-content am-cf">
                <div class="row">

                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                        <div class="widget am-cf">
                            <div class="widget-head am-cf">
                                <div class="widget-title am-fl"><h1 style="display:inline">管理视频</h1><a href="<?php echo U('Club/video/addvideo');?>">添加视频</a></div>
                            </div>
                            <div class="widget-body  widget-body-lg am-fr">
                                    <table width="100%" class="am-table am-table-compact am-table-striped tpl-table-black ">
                                        <thead>
                                            <tr>
                                                <th>序号</th>
                                                <th>视频名</th>
                                                <th>发布人</th>
                                                <th>发布时间</th>
                                                <th>操作</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php if(is_array($video)): $i = 0; $__LIST__ = $video;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><div id="video">
                                                <video src="" autoplay="autoplay" controls="controls" onclick="none()" id="play"
                                                width="800" height="600"></video>
                                            </div>
                                            <tr class="gradeX">
                                                <td class="am-text-middle"><?php echo ($i); ?></td>
                                                <td class="am-text-middle"><a href="javascript:video(<?php echo ($vo["videoid"]); ?>)"><?php echo ($vo["videoname"]); ?></a></td>
                                                <td class="am-text-middle"><?php echo ($vo["coachname"]); ?></td>
                                                <td class="am-text-middle"><?php echo ($vo["time"]); ?></td>
                                                <td class="am-text-middle">
                                                    <div class="tpl-table-black-operation">
                                                        <a href="<?php echo U('Club/coach/delete',array('coachid'=>$vo['coachid']));?>" class="tpl-table-black-operation-del">
                                                            <i class="am-icon-trash"></i> 删除
                                                        </a>
                                                    </div>
                                                </td>
                                            </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                                        </tbody>
                                    </table>

                            </div>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>
    </div>

        <script src="/neu_yuejian201/Public//neu_yuejian201/Public//neu_yuejian201/Public//neu_yuejian201/Public/assets/js/amazeui.min.js"></script>
    <script src="/neu_yuejian201/Public//neu_yuejian201/Public//neu_yuejian201/Public/assets/js/amazeui.datatables.min.js"></script>
    <script src="/neu_yuejian201/Public//neu_yuejian201/Public/assets/js/dataTables.responsive.min.js"></script>
    <script src="/neu_yuejian201/Public/assets/js/app.js"></script>
</body>
<script type="text/javascript">
function getxmlrequest(){
  if(XMLHttpRequest == "undefined"){
    XMLHttpRequest = function(){
      try{return new ActiveXObject("Msxml2.XMLHTTP.6.0");}
      catch(e){}
      try{return new ActiveXObject("Msxml2.XMLHTTP.3.0");}
      catch(e){}
      try{return new ActiveXObject("Msxml2.XMLHTTP");}
      catch(e){}
      try{return new ActiveXObject("Microsoft.XMLHTTP");}
      catch(e){}
      return false;
    }
  }
  return new XMLHttpRequest();
}

function video(id){
  var request = getxmlrequest();
  if(request){
    request.open("GET","videoname?id="+id,true);
    request.onreadystatechange = function(){
      if(request.readyState == 4){
        var name = request.responseText;  
        // var obj = document.getElementById("my-popups");
        // var inputObj = obj.getElementsByTagName("input");
        // var textArea = obj.getElementsByTagName("textarea"); 
        var json = JSON.parse(name);
        var abc = json.video;
        document.getElementById("video").style.display="inline";
        document.getElementById("play").src="/neu_yuejian201/Public/photo/"+abc;
        document.getElementById("play").play();
      }
    };
    request.send(null);   
  }else{
    alert("不支持ajax");
  }
}

    function none(){
        document.getElementById("video").style.display="none";
        document.getElementById("play").src="";
    }
</script>
</html>